import 'package:json_annotation/json_annotation.dart';

part 'ncov_response.g.dart';


@JsonSerializable()
class NcovResponse extends Object {

  @JsonKey(name: 'code')
  int code;

  @JsonKey(name: 'msg')
  String msg;

  @JsonKey(name: 'newslist')
  List<Newslist> newslist;

  NcovResponse(this.code,this.msg,this.newslist,);

  factory NcovResponse.fromJson(Map<String, dynamic> srcJson) => _$NcovResponseFromJson(srcJson);

  Map<String, dynamic> toJson() => _$NcovResponseToJson(this);

}


@JsonSerializable()
class Newslist extends Object {

  @JsonKey(name: 'news')
  List<News> news;

  @JsonKey(name: 'desc')
  Desc desc;

  @JsonKey(name: 'riskarea')
  Riskarea riskarea;

  Newslist(this.news,this.desc,this.riskarea,);

  factory Newslist.fromJson(Map<String, dynamic> srcJson) => _$NewslistFromJson(srcJson);

  Map<String, dynamic> toJson() => _$NewslistToJson(this);

}


@JsonSerializable()
class News extends Object {

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'pubDate')
  int pubDate;

  @JsonKey(name: 'pubDateStr')
  String pubDateStr;

  @JsonKey(name: 'title')
  String title;

  @JsonKey(name: 'summary')
  String summary;

  @JsonKey(name: 'infoSource')
  String infoSource;

  @JsonKey(name: 'sourceUrl')
  String sourceUrl;

  News(this.id,this.pubDate,this.pubDateStr,this.title,this.summary,this.infoSource,this.sourceUrl,);

  factory News.fromJson(Map<String, dynamic> srcJson) => _$NewsFromJson(srcJson);

  Map<String, dynamic> toJson() => _$NewsToJson(this);

}


@JsonSerializable()
class Desc extends Object {

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'createTime')
  int createTime;

  @JsonKey(name: 'modifyTime')
  int modifyTime;

  @JsonKey(name: 'currentConfirmedCount')
  int currentConfirmedCount;

  @JsonKey(name: 'confirmedCount')
  int confirmedCount;

  @JsonKey(name: 'suspectedCount')
  int suspectedCount;

  @JsonKey(name: 'curedCount')
  int curedCount;

  @JsonKey(name: 'deadCount')
  int deadCount;

  @JsonKey(name: 'seriousCount')
  int seriousCount;

  @JsonKey(name: 'remark1')
  String remark1;

  @JsonKey(name: 'remark2')
  String remark2;

  @JsonKey(name: 'remark3')
  String remark3;

  @JsonKey(name: 'note1')
  String note1;

  @JsonKey(name: 'note2')
  String note2;

  @JsonKey(name: 'note3')
  String note3;

  @JsonKey(name: 'foreignStatistics')
  ForeignStatistics foreignStatistics;

  @JsonKey(name: 'globalStatistics')
  GlobalStatistics globalStatistics;

  @JsonKey(name: 'highDangerCount')
  int highDangerCount;

  @JsonKey(name: 'midDangerCount')
  int midDangerCount;

  Desc(this.id,this.createTime,this.modifyTime,this.currentConfirmedCount,this.confirmedCount,this.suspectedCount,this.curedCount,this.deadCount,this.seriousCount,this.remark1,this.remark2,this.remark3,this.note1,this.note2,this.note3,this.foreignStatistics,this.globalStatistics,this.highDangerCount,this.midDangerCount,);

  factory Desc.fromJson(Map<String, dynamic> srcJson) => _$DescFromJson(srcJson);

  Map<String, dynamic> toJson() => _$DescToJson(this);

}


@JsonSerializable()
class ForeignStatistics extends Object {

  @JsonKey(name: 'currentConfirmedCount')
  int currentConfirmedCount;

  @JsonKey(name: 'confirmedCount')
  int confirmedCount;

  @JsonKey(name: 'suspectedCount')
  int suspectedCount;

  @JsonKey(name: 'curedCount')
  int curedCount;

  @JsonKey(name: 'deadCount')
  int deadCount;

  @JsonKey(name: 'suspectedIncr')
  int suspectedIncr;

  @JsonKey(name: 'currentConfirmedIncr')
  int currentConfirmedIncr;

  @JsonKey(name: 'confirmedIncr')
  int confirmedIncr;

  @JsonKey(name: 'curedIncr')
  int curedIncr;

  @JsonKey(name: 'deadIncr')
  int deadIncr;

  ForeignStatistics(this.currentConfirmedCount,this.confirmedCount,this.suspectedCount,this.curedCount,this.deadCount,this.suspectedIncr,this.currentConfirmedIncr,this.confirmedIncr,this.curedIncr,this.deadIncr,);

  factory ForeignStatistics.fromJson(Map<String, dynamic> srcJson) => _$ForeignStatisticsFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ForeignStatisticsToJson(this);

}


@JsonSerializable()
class GlobalStatistics extends Object {

  @JsonKey(name: 'currentConfirmedCount')
  int currentConfirmedCount;

  @JsonKey(name: 'confirmedCount')
  int confirmedCount;

  @JsonKey(name: 'curedCount')
  int curedCount;

  @JsonKey(name: 'deadCount')
  int deadCount;

  GlobalStatistics(this.currentConfirmedCount,this.confirmedCount,this.curedCount,this.deadCount,);

  factory GlobalStatistics.fromJson(Map<String, dynamic> srcJson) => _$GlobalStatisticsFromJson(srcJson);

  Map<String, dynamic> toJson() => _$GlobalStatisticsToJson(this);

}


@JsonSerializable()
class Riskarea extends Object {

  @JsonKey(name: 'mid')
  List<String> mid;

  @JsonKey(name: 'high')
  List<String> high;

  Riskarea(this.mid,this.high,);

  factory Riskarea.fromJson(Map<String, dynamic> srcJson) => _$RiskareaFromJson(srcJson);

  Map<String, dynamic> toJson() => _$RiskareaToJson(this);

}


